home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / dxva.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-16  |  32.5 KB  |  922 lines

  1. //------------------------------------------------------------------------------
  2. // File: DXVA.h
  3. //
  4. // Desc: DirectX Video Acceleration header file.
  5. //
  6. // Copyright (c) 1999 - 2002, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. #ifndef __DIRECTX_VA__
  11. #define __DIRECTX_VA__
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. DEFINE_GUID(DXVA_ModeNone,    0x1b81be00, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  18. DEFINE_GUID(DXVA_ModeH261_A,  0x1b81be01, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  19. DEFINE_GUID(DXVA_ModeH261_B,  0x1b81be02, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  20.  
  21. DEFINE_GUID(DXVA_ModeH263_A,  0x1b81be03, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  22. DEFINE_GUID(DXVA_ModeH263_B,  0x1b81be04, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  23. DEFINE_GUID(DXVA_ModeH263_C,  0x1b81be05, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  24. DEFINE_GUID(DXVA_ModeH263_D,  0x1b81be06, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  25. DEFINE_GUID(DXVA_ModeH263_E,  0x1b81be07, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  26. DEFINE_GUID(DXVA_ModeH263_F,  0x1b81be08, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  27.  
  28. DEFINE_GUID(DXVA_ModeMPEG1_A, 0x1b81be09, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  29.  
  30. DEFINE_GUID(DXVA_ModeMPEG2_A, 0x1b81be0A, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  31. DEFINE_GUID(DXVA_ModeMPEG2_B, 0x1b81be0B, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  32. DEFINE_GUID(DXVA_ModeMPEG2_C, 0x1b81be0C, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  33. DEFINE_GUID(DXVA_ModeMPEG2_D, 0x1b81be0D, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  34.  
  35. DEFINE_GUID(DXVA_ModeWMV8_A,  0x1b81be80, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  36. DEFINE_GUID(DXVA_ModeWMV8_B,  0x1b81be81, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  37.  
  38. DEFINE_GUID(DXVA_ModeWMV9_A,  0x1b81be90, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  39. DEFINE_GUID(DXVA_ModeWMV9_B,  0x1b81be91, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  40. DEFINE_GUID(DXVA_ModeWMV9_Ai, 0x1b81be92, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  41. DEFINE_GUID(DXVA_ModeWMV9_Bi, 0x1b81be93, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  42.  
  43.  
  44. DEFINE_GUID(DXVA_NoEncrypt,   0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
  45.  
  46. #define DXVA_RESTRICTED_MODE_UNRESTRICTED        0xFFFF
  47. #define DXVA_RESTRICTED_MODE_H261_A              1
  48. #define DXVA_RESTRICTED_MODE_H261_B              2
  49.  
  50. #define DXVA_RESTRICTED_MODE_H263_A              3
  51. #define DXVA_RESTRICTED_MODE_H263_B              4
  52. #define DXVA_RESTRICTED_MODE_H263_C              5
  53. #define DXVA_RESTRICTED_MODE_H263_D              6
  54. #define DXVA_RESTRICTED_MODE_H263_E              7
  55. #define DXVA_RESTRICTED_MODE_H263_F              8
  56.  
  57. #define DXVA_RESTRICTED_MODE_MPEG1_A             9
  58.  
  59. #define DXVA_RESTRICTED_MODE_MPEG2_A             0xA
  60. #define DXVA_RESTRICTED_MODE_MPEG2_B             0xB
  61. #define DXVA_RESTRICTED_MODE_MPEG2_C             0xC
  62. #define DXVA_RESTRICTED_MODE_MPEG2_D             0xD
  63.  
  64. #define DXVA_RESTRICTED_MODE_WMV8_A              0x80
  65. #define DXVA_RESTRICTED_MODE_WMV8_B              0x81
  66.  
  67. #define DXVA_RESTRICTED_MODE_WMV9_A              0x90
  68. #define DXVA_RESTRICTED_MODE_WMV9_B              0x91
  69. #define DXVA_RESTRICTED_MODE_WMV9_Ai             0x92
  70. #define DXVA_RESTRICTED_MODE_WMV9_Bi             0x93
  71.  
  72.  
  73. #define DXVA_COMPBUFFER_TYPE_THAT_IS_NOT_USED    0
  74. #define DXVA_PICTURE_DECODE_BUFFER               1
  75. #define DXVA_MACROBLOCK_CONTROL_BUFFER           2
  76. #define DXVA_RESIDUAL_DIFFERENCE_BUFFER          3
  77. #define DXVA_DEBLOCKING_CONTROL_BUFFER           4
  78. #define DXVA_INVERSE_QUANTIZATION_MATRIX_BUFFER  5
  79. #define DXVA_SLICE_CONTROL_BUFFER                6
  80. #define DXVA_BITSTREAM_DATA_BUFFER               7
  81. #define DXVA_AYUV_BUFFER                         8
  82. #define DXVA_IA44_SURFACE_BUFFER                 9
  83. #define DXVA_DPXD_SURFACE_BUFFER                10
  84. #define DXVA_HIGHLIGHT_BUFFER                   11
  85. #define DXVA_DCCMD_SURFACE_BUFFER               12
  86. #define DXVA_ALPHA_BLEND_COMBINATION_BUFFER     13
  87. #define DXVA_PICTURE_RESAMPLE_BUFFER            14
  88. #define DXVA_READ_BACK_BUFFER                   15
  89.  
  90. #define DXVA_NUM_TYPES_COMP_BUFFERS             16
  91.  
  92. /* values for bDXVA_Func */
  93. #define DXVA_PICTURE_DECODING_FUNCTION        1
  94. #define DXVA_ALPHA_BLEND_DATA_LOAD_FUNCTION   2
  95. #define DXVA_ALPHA_BLEND_COMBINATION_FUNCTION 3
  96. #define DXVA_PICTURE_RESAMPLE_FUNCTION        4
  97.  
  98. /* values returned from Execute command in absence of read-back */
  99. #define DXVA_EXECUTE_RETURN_OK                  0
  100. #define DXVA_EXECUTE_RETURN_DATA_ERROR_MINOR    1
  101. #define DXVA_EXECUTE_RETURN_DATA_ERROR_SIGNIF   2
  102. #define DXVA_EXECUTE_RETURN_DATA_ERROR_SEVERE   3
  103. #define DXVA_EXECUTE_RETURN_OTHER_ERROR_SEVERE  4
  104.  
  105.  
  106. #pragma pack(push, BeforeDXVApacking, 1)
  107.  
  108.  
  109. typedef struct _DXVA_ConnectMode {
  110.   GUID guidMode;
  111.   WORD wRestrictedMode;
  112. } DXVA_ConnectMode, *LPDXVA_ConnectMode;
  113.  
  114.  
  115. typedef DWORD DXVA_ConfigQueryOrReplyFunc, *LPDXVA_ConfigQueryOrReplyFunc;
  116.  
  117. #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY     0xFFFFF1
  118. #define DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY      0xFFFFF5
  119. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_COPY     0xFFFFF8
  120. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_PLUS     0xFFFFF9
  121. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_OK_COPY      0xFFFFFC
  122. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_FALSE_PLUS  0xFFFFFB
  123. #define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_FALSE_PLUS   0xFFFFFF
  124.  
  125. #define readDXVA_QueryOrReplyFuncFlag(ptr)        ((*(ptr)) >> 8)
  126.  
  127. #define readDXVA_QueryOrReplyFuncFlag_ACCEL(ptr)  (((*(ptr)) >> 11) & 1)
  128. #define readDXVA_QueryOrReplyFuncFlag_LOCK(ptr)   (((*(ptr)) >> 10) & 1)
  129. #define readDXVA_QueryOrReplyFuncFlag_BAD(ptr)    (((*(ptr)) >>  9) & 1)
  130. #define readDXVA_QueryOrReplyFuncFlag_PLUS(ptr)   (((*(ptr)) >>  8) & 1)
  131.  
  132. #define readDXVA_QueryOrReplyFuncFunc(ptr)        ((*(ptr)) & 0xFF)
  133.  
  134. #define writeDXVA_QueryOrReplyFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
  135.  
  136. #define setDXVA_QueryOrReplyFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
  137. #define setDXVA_QueryOrReplyFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
  138.  
  139. typedef DWORD DXVA_EncryptProtocolFunc, *LPDXVA_EncryptProtocolFunc;
  140.  
  141. #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_HOST    0xFFFF00
  142. #define DXVA_ENCRYPTPROTOCOLFUNCFLAG_ACCEL   0xFFFF08
  143.  
  144. #define readDXVA_EncryptProtocolFuncFlag(ptr)        ((*(ptr)) >> 8)
  145. #define readDXVA_EncryptProtocolFuncFlag_ACCEL(ptr)  (((*(ptr)) >> 11) & 1)
  146.  
  147. #define readDXVA_EncryptProtocolFuncFunc(ptr)        ((*(ptr)) & 0xFF)
  148.  
  149. #define writeDXVA_EncryptProtocolFunc(ptr, flg, fnc) ((*(ptr)) = ((flg) << 8) | (fnc))
  150.  
  151. #define setDXVA_EncryptProtocolFuncFlag(ptr, flg) ((*(ptr)) |= ((flg) << 8))
  152. #define setDXVA_EncryptProtocolFuncFunc(ptr, fnc) ((*(ptr)) |= (fnc));
  153.  
  154. typedef struct _DXVA_EncryptProtocolHeader {
  155.   DXVA_EncryptProtocolFunc dwFunction;
  156.   DWORD ReservedBits[3];
  157.   GUID  guidEncryptProtocol;
  158. } DXVA_EncryptProtocolHeader, *LPDXVA_EncryptProtocolHeader;
  159.  
  160. typedef struct _DXVA_ConfigPictureDecode {
  161.  
  162.   // Operation Indicated
  163.   DXVA_ConfigQueryOrReplyFunc dwFunction;
  164.  
  165.   // Alignment
  166.   DWORD dwReservedBits[3];
  167.  
  168.   // Encryption GUIDs
  169.   GUID guidConfigBitstreamEncryption;
  170.   GUID guidConfigMBcontrolEncryption;
  171.   GUID guidConfigResidDiffEncryption;
  172.  
  173.   // Bitstream Processing Indicator
  174.   BYTE bConfigBitstreamRaw;
  175.  
  176.   // Macroblock Control Config
  177.   BYTE bConfigMBcontrolRasterOrder;
  178.  
  179.   // Host Resid Diff Config
  180.   BYTE bConfigResidDiffHost;
  181.   BYTE bConfigSpatialResid8;
  182.   BYTE bConfigResid8Subtraction;
  183.   BYTE bConfigSpatialHost8or9Clipping;
  184.   BYTE bConfigSpatialResidInterleaved;
  185.   BYTE bConfigIntraResidUnsigned;
  186.  
  187.   // Accelerator Resid Diff Config
  188.   BYTE bConfigResidDiffAccelerator;
  189.   BYTE bConfigHostInverseScan;
  190.   BYTE bConfigSpecificIDCT;
  191.   BYTE bConfig4GroupedCoefs;
  192. } DXVA_ConfigPictureDecode, *LPDXVA_ConfigPictureDecode;
  193.  
  194.  
  195. /* Picture Decoding Parameters */
  196.  
  197. typedef struct _DXVA_PictureParameters {
  198.  
  199.   WORD wDecodedPictureIndex;
  200.   WORD wDeblockedPictureIndex;
  201.  
  202.   WORD wForwardRefPictureIndex;
  203.   WORD wBackwardRefPictureIndex;
  204.  
  205.   WORD wPicWidthInMBminus1;
  206.   WORD wPicHeightInMBminus1;
  207.  
  208.   BYTE bMacroblockWidthMinus1;
  209.   BYTE bMacroblockHeightMinus1;
  210.  
  211.   BYTE bBlockWidthMinus1;
  212.   BYTE bBlockHeightMinus1;
  213.  
  214.   BYTE bBPPminus1;
  215.  
  216.   BYTE bPicStructure;
  217.   BYTE bSecondField;
  218.   BYTE bPicIntra;
  219.   BYTE bPicBackwardPrediction;
  220.  
  221.   BYTE bBidirectionalAveragingMode;
  222.   BYTE bMVprecisionAndChromaRelation;
  223.   BYTE bChromaFormat;
  224.  
  225.   BYTE bPicScanFixed;
  226.   BYTE bPicScanMethod;
  227.   BYTE bPicReadbackRequests;
  228.  
  229.   BYTE bRcontrol;
  230.   BYTE bPicSpatialResid8;
  231.   BYTE bPicOverflowBlocks;
  232.   BYTE bPicExtrapolation;
  233.  
  234.   BYTE bPicDeblocked;
  235.   BYTE bPicDeblockConfined;
  236.   BYTE bPic4MVallowed;
  237.   BYTE bPicOBMC;
  238.   BYTE bPicBinPB;
  239.   BYTE bMV_RPS;
  240.  
  241.   BYTE bReservedBits;
  242.  
  243.   WORD wBitstreamFcodes;
  244.   WORD wBitstreamPCEelements;
  245.   BYTE bBitstreamConcealmentNeed;
  246.   BYTE bBitstreamConcealmentMethod;
  247.  
  248. } DXVA_PictureParameters, *LPDXVA_PictureParameters;
  249.  
  250.  
  251.  
  252. /* Picture Resampling */
  253.  
  254. typedef struct _DXVA_PicResample {
  255.  
  256.   WORD  wPicResampleSourcePicIndex;
  257.   WORD  wPicResampleDestPicIndex;
  258.  
  259.   WORD  wPicResampleRcontrol;
  260.   BYTE  bPicResampleExtrapWidth;
  261.   BYTE  bPicResampleExtrapHeight;
  262.  
  263.   DWORD dwPicResampleSourceWidth;
  264.   DWORD dwPicResampleSourceHeight;
  265.  
  266.   DWORD dwPicResampleDestWidth;
  267.   DWORD dwPicResampleDestHeight;
  268.  
  269.   DWORD dwPicResampleFullDestWidth;
  270.   DWORD dwPicResampleFullDestHeight;
  271.  
  272. } DXVA_PicResample, *LPDXVA_PicResample;
  273.  
  274.  
  275. #define DXVA_CHROMA_FORMAT_420 1
  276. #define DXVA_CHROMA_FORMAT_422 2
  277. #define DXVA_CHROMA_FORMAT_444 3
  278.  
  279. #define DXVA_PICTURE_STRUCTURE_TOP_FIELD    1
  280. #define DXVA_PICTURE_STRUCTURE_BOTTOM_FIELD 2
  281. #define DXVA_PICTURE_STRUCTURE_FRAME        3
  282.  
  283. #define DXVA_BIDIRECTIONAL_AVERAGING_MPEG2_ROUND 0
  284. #define DXVA_BIDIRECTIONAL_AVERAGING_H263_TRUNC  1
  285.  
  286. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_MPEG2  0
  287. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H263   1
  288. #define DXVA_MV_PRECISION_AND_CHROMA_RELATION_H261   2
  289.  
  290. #define DXVA_SCAN_METHOD_ZIG_ZAG              0
  291. #define DXVA_SCAN_METHOD_ALTERNATE_VERTICAL   1
  292. #define DXVA_SCAN_METHOD_ALTERNATE_HORIZONTAL 2
  293. #define DXVA_SCAN_METHOD_ARBITRARY            3
  294.  
  295. #define DXVA_BITSTREAM_CONCEALMENT_NEED_UNLIKELY 0
  296. #define DXVA_BITSTREAM_CONCEALMENT_NEED_MILD     1
  297. #define DXVA_BITSTREAM_CONCEALMENT_NEED_LIKELY   2
  298. #define DXVA_BITSTREAM_CONCEALMENT_NEED_SEVERE   3
  299.  
  300. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_UNSPECIFIED 0
  301. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_INTRA       1
  302. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_FORWARD     2
  303. #define DXVA_BITSTREAM_CONCEALMENT_METHOD_BACKWARD    3
  304.  
  305.  
  306. /* Buffer Description Data */
  307.  
  308. typedef struct _DXVA_BufferDescription {
  309.   DWORD dwTypeIndex;
  310.   DWORD dwBufferIndex;
  311.   DWORD dwDataOffset;
  312.   DWORD dwDataSize;
  313.   DWORD dwFirstMBaddress;
  314.   DWORD dwNumMBsInBuffer;
  315.   DWORD dwWidth;
  316.   DWORD dwHeight;
  317.   DWORD dwStride;
  318.   DWORD dwReservedBits;
  319. } DXVA_BufferDescription, *LPDXVA_BufferDescription;
  320.  
  321.  
  322. /* Off-Host IDCT Coefficient Data Structures */
  323.  
  324. typedef struct _DXVA_TCoef4Group {
  325.   BYTE  TCoefIDX[4];
  326.   SHORT TCoefValue[4];
  327. } DXVA_TCoef4Group, *LPDXVA_TCoef4Group;
  328.  
  329. typedef struct _DXVA_TCoefSingle {
  330.   WORD  wIndexWithEOB;
  331.   SHORT TCoefValue;
  332. } DXVA_TCoefSingle, *LPDXVA_TCoefSingle;
  333.  
  334. /* Macros for Reading EOB and Index Values */
  335.  
  336. #define readDXVA_TCoefSingleIDX(ptr) ((ptr)->wIndexWithEOB >> 1)
  337. #define readDXVA_TCoefSingleEOB(ptr) ((ptr)->wIndexWithEOB & 1)
  338.  
  339. /* Macro for Writing EOB and Index Values */
  340.  
  341. #define writeDXVA_TCoefSingleIndexWithEOB(ptr, idx, eob) ((ptr)->wIndexWithEOB = ((idx) << 1) | (eob))
  342. #define setDXVA_TCoefSingleIDX(ptr, idx) ((ptr)->wIndexWithEOB |= ((idx) << 1))
  343. #define setDXVA_TCoefSingleEOB(ptr)      ((ptr)->wIndexWithEOB |= 1)
  344.  
  345. /* Spatial-Domain Residual Difference Blocks */
  346.  
  347. #define DXVA_USUAL_BLOCK_WIDTH   8
  348. #define DXVA_USUAL_BLOCK_HEIGHT  8
  349. #define DXVA_USUAL_BLOCK_SIZE   (DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT)
  350.  
  351. typedef SHORT       DXVA_Sample16[DXVA_USUAL_BLOCK_SIZE];
  352. typedef signed char DXVA_Sample8 [DXVA_USUAL_BLOCK_SIZE];
  353.  
  354. /* Deblocking Filter Control Structure */
  355.  
  356. typedef BYTE DXVA_DeblockingEdgeControl;
  357.  
  358. typedef DXVA_DeblockingEdgeControl * LPDXVA_DeblockingEdgeControl;
  359.  
  360. /* Macros for Reading STRENGTH and FilterOn */
  361.  
  362. #define readDXVA_EdgeFilterStrength(ptr) ((*(ptr)) >> 1)
  363. #define readDXVA_EdgeFilterOn(ptr)       ((*(ptr)) & 1)
  364.  
  365. /* Macro for Writing STRENGTH and FilterOn */
  366.  
  367. #define writeDXVA_DeblockingEdgeControl(ptr, str, fon) ((*(ptr)) = ((str) << 1) | (fon))
  368. #define setDXVA_EdgeFilterStrength(ptr, str)           ((*(ptr)) |= ((str) << 1))
  369. #define setDXVA_EdgeFilterOn(ptr)                      ((*(ptr)) |= 1)
  370.  
  371.  
  372. /* Macroblock Control Command Data Structures */
  373.  
  374. typedef struct _DXVA_MVvalue {
  375.   SHORT horz, vert;
  376. } DXVA_MVvalue, *LPDXVA_MVvalue;
  377.  
  378.  
  379. /* Inverse Quantization Matrices */
  380.  
  381. typedef struct _DXVA_QmatrixData {
  382.   BYTE bNewQmatrix[4]; /* intra Y, inter Y, intra chroma, inter chroma */
  383.   WORD Qmatrix[4][DXVA_USUAL_BLOCK_WIDTH * DXVA_USUAL_BLOCK_HEIGHT];
  384. } DXVA_QmatrixData, *LPDXVA_QmatrixData;
  385.  
  386.  
  387. /* Slice Control Buffer Data */
  388.  
  389. typedef struct _DXVA_SliceInfo {
  390.   WORD  wHorizontalPosition;
  391.   WORD  wVerticalPosition;
  392.   DWORD dwSliceBitsInBuffer;
  393.   DWORD dwSliceDataLocation;
  394.   BYTE  bStartCodeBitOffset;
  395.   BYTE  bReservedBits;
  396.   WORD  wMBbitOffset;
  397.   WORD  wNumberMBsInSlice;
  398.   WORD  wQuantizerScaleCode;
  399.   WORD  wBadSliceChopping;
  400. } DXVA_SliceInfo, *LPDXVA_SliceInfo;
  401.  
  402.  
  403. #define DXVA_NumMV_OBMC_off_BinPBwith4MV_off    4
  404. #define DXVA_NumMV_OBMC_off_BinPBwith4MV_on  (4+1)
  405. #define DXVA_NumMV_OBMC_on__BinPB_off         (10)
  406. #define DXVA_NumMV_OBMC_on__BinPB_on          (11) /* not current standards */
  407.  
  408. #define DXVA_NumBlocksPerMB_420 (4+2+0)
  409. #define DXVA_NumBlocksPerMB_422 (4+2+2)
  410. #define DXVA_NumBlocksPerMB_444 (4+4+4)
  411.  
  412. /* Basic form for I pictures */
  413. /* Host Residual Differences */
  414. typedef struct _DXVA_MBctrl_I_HostResidDiff_1 {
  415.   WORD  wMBaddress;
  416.   WORD  wMBtype;
  417.   DWORD dwMB_SNL;
  418.   WORD  wPatternCode;
  419.   WORD  wPC_Overflow; /* zero if not overflow format */
  420.   DWORD dwReservedBits2;
  421. } DXVA_MBctrl_I_HostResidDiff_1;
  422.  
  423. /* Basic form for I pictures */
  424. /* Off-Host IDCT, 4:2:0 sampling */
  425. typedef struct _DXVA_MBctrl_I_OffHostIDCT_1 {
  426.   WORD  wMBaddress;
  427.   WORD  wMBtype;
  428.   DWORD dwMB_SNL;
  429.   WORD  wPatternCode;
  430.   BYTE  bNumCoef[DXVA_NumBlocksPerMB_420];
  431. } DXVA_MBctrl_I_OffHostIDCT_1;
  432.  
  433. /* Basic form for P and B pictures */
  434. /* Should also be used for concealment MVs in MPEG-2 I pictures */
  435. /* Without OBMC, without BinPB and 4MV together, without MV RPS */
  436. /* Host Residual Differences */
  437. typedef struct _DXVA_MBctrl_P_HostResidDiff_1 {
  438.   WORD         wMBaddress;
  439.   WORD         wMBtype;
  440.   DWORD        dwMB_SNL;
  441.   WORD         wPatternCode;
  442.   WORD         wPC_Overflow; /* zero if not overflow format */
  443.   DWORD        dwReservedBits2;
  444.   DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
  445. } DXVA_MBctrl_P_HostResidDiff_1;
  446.  
  447. /* Basic form for P and B pictures */
  448. /* Without OBMC, without BinPB and 4MV together, without MV RPS */
  449. /* Off-Host IDCT, 4:2:0 sampling */
  450. typedef struct _DXVA_MBctrl_P_OffHostIDCT_1 {
  451.   WORD         wMBaddress;
  452.   WORD         wMBtype;
  453.   DWORD        dwMB_SNL;
  454.   WORD         wPatternCode;
  455.   BYTE         bNumCoef[DXVA_NumBlocksPerMB_420];
  456.   DXVA_MVvalue MVector[DXVA_NumMV_OBMC_off_BinPBwith4MV_off];
  457. } DXVA_MBctrl_P_OffHostIDCT_1;
  458.  
  459. /* How to load alpha blending graphic data */
  460. typedef struct _DXVA_ConfigAlphaLoad {
  461.  
  462.   // Operation Indicated
  463.   DXVA_ConfigQueryOrReplyFunc dwFunction;
  464.  
  465.   // Alignment
  466.   DWORD dwReservedBits[3];
  467.  
  468.   BYTE  bConfigDataType;
  469. } DXVA_ConfigAlphaLoad, *LPDXVA_ConfigAlphaLoad;
  470.  
  471. #define DXVA_CONFIG_DATA_TYPE_IA44  0
  472. #define DXVA_CONFIG_DATA_TYPE_AI44  1
  473. #define DXVA_CONFIG_DATA_TYPE_DPXD  2
  474. #define DXVA_CONFIG_DATA_TYPE_AYUV  3
  475.  
  476.  
  477. /* How to combine alpha blending graphic data */
  478. typedef struct _DXVA_ConfigAlphaCombine {
  479.  
  480.   // Operation Indicated
  481.   DXVA_ConfigQueryOrReplyFunc dwFunction;
  482.  
  483.   // Alignment
  484.   DWORD dwReservedBits[3];
  485.  
  486.   BYTE  bConfigBlendType;
  487.   BYTE  bConfigPictureResizing;
  488.   BYTE  bConfigOnlyUsePicDestRectArea;
  489.   BYTE  bConfigGraphicResizing;
  490.   BYTE  bConfigWholePlaneAlpha;
  491.  
  492. } DXVA_ConfigAlphaCombine, *LPDXVA_ConfigAlphaCombine;
  493.  
  494. #define DXVA_CONFIG_BLEND_TYPE_FRONT_BUFFER   0
  495. #define DXVA_CONFIG_BLEND_TYPE_BACK_HARDWARE  1
  496.  
  497.  
  498. /* AYUV sample for 16-entry YUV palette or graphic surface */
  499.  
  500. typedef struct _DXVA_AYUVsample2 {
  501.   BYTE bCrValue;
  502.   BYTE bCbValue;
  503.   BYTE bY_Value;
  504.   BYTE bSampleAlpha8;
  505. } DXVA_AYUVsample2, *LPDXVA_AYUVsample2;
  506.  
  507. /* Macros for IA44 alpha blending surface samples */
  508.  
  509. typedef BYTE DXVA_IA44sample, *LPDXVA_IA44sample;
  510.  
  511. #define readDXVA_IA44index(ptr) (((*(ptr)) & 0xF0) >> 4)
  512. #define readDXVA_IA44alpha(ptr)  ((*(ptr)) & 0x0F)
  513.  
  514. #define writeDXVA_IA44(ptr, idx, alpha) ((*(ptr)) = (((idx) << 4) | (alpha)))
  515.  
  516. #define setDXVA_IA44index(ptr, idx)    ((*(ptr)) |= ((idx) << 4))
  517. #define setDXVA_IA44alpha(ptr, alpha)  ((*(ptr)) |= (alpha))
  518.  
  519. /* Macros for AI44 alpha blending surface samples */
  520.  
  521. typedef BYTE DXVA_AI44sample, *LPDXVA_AI44sample;
  522.  
  523. #define readDXVA_AI44index(ptr)  ((*(ptr)) & 0x0F)
  524. #define readDXVA_AI44alpha(ptr) (((*(ptr)) & 0xF0) >> 4)
  525.  
  526. #define writeDXVA_AI44(ptr, idx, alpha) ((*(ptr)) = (((alpha) << 4) | (idx)))
  527.  
  528. #define setDXVA_AI44index(ptr, idx)    ((*(ptr)) |= (idx))
  529. #define setDXVA_AI44alpha(ptr, alpha)  ((*(ptr)) |= ((alpha) << 4))
  530.  
  531.  
  532. /* Highlight data structure */
  533.  
  534. typedef struct _DXVA_Highlight {
  535.   WORD wHighlightActive;
  536.   WORD wHighlightIndices;
  537.   WORD wHighlightAlphas;
  538.   RECT HighlightRect;
  539. } DXVA_Highlight, *LPDXVA_Highlight;
  540.  
  541. typedef BYTE DXVA_DPXD,  *LPDXVA_DPXD;
  542. typedef WORD DXVA_DCCMD, *LPDXVA_DCCMD;
  543.  
  544. /* Alpha blend combination */
  545.  
  546. typedef struct _DXVA_BlendCombination {
  547.   WORD wPictureSourceIndex;
  548.   WORD wBlendedDestinationIndex;
  549.   RECT PictureSourceRect16thPel;
  550.   RECT PictureDestinationRect;
  551.   RECT GraphicSourceRect;
  552.   RECT GraphicDestinationRect;
  553.   WORD wBlendDelay;
  554.   BYTE bBlendOn;
  555.   BYTE bWholePlaneAlpha;
  556.   DXVA_AYUVsample2 OutsideYUVcolor;
  557. } DXVA_BlendCombination, *LPDXVA_BlendCombination;
  558.  
  559.  
  560. #pragma pack(push, 16)
  561.  
  562.  
  563. typedef DXVA_MBctrl_I_HostResidDiff_1 *
  564.        LPDXVA_MBctrl_I_HostResidDiff_1;
  565.  
  566. typedef DXVA_MBctrl_I_OffHostIDCT_1 *
  567.        LPDXVA_MBctrl_I_OffHostIDCT_1;
  568.  
  569. typedef DXVA_MBctrl_P_HostResidDiff_1 *
  570.        LPDXVA_MBctrl_P_HostResidDiff_1;
  571.  
  572. typedef DXVA_MBctrl_P_OffHostIDCT_1 *
  573.        LPDXVA_MBctrl_P_OffHostIDCT_1;
  574.  
  575.  
  576. #pragma pack(pop)
  577.  
  578. /*
  579.  * Other forms of pictures are constructed in the obvious way
  580.  * from the above by adjusting the number of residual difference
  581.  * blocks, the number of motion vectors per macroblock, etc.
  582.  */
  583.  
  584. #define readDXVA_MBskipsFollowing(ptr)       (((ptr)->dwMB_SNL & 0xFF000000) >> 24)
  585. #define readDXVA_MBdataLocation(ptr)         (((ptr)->dwMB_SNL & 0x00FFFFFF))
  586.  
  587. #define writeDXVA_MB_SNL(ptr, skips, dloc)   ((ptr)->dwMB_SNL = (((skips) << 24) | (dloc)))
  588. #define setDXVA_MBskipsFollowing(ptr, skips) ((ptr)->dwMB_SNL |= ((skips) << 24))
  589. #define setDXVA_MBdataLocation(ptr, dloc)    ((ptr)->dwMB_SNL |= (dloc))
  590.  
  591. #define readDXVA_MvertFieldSel_3(ptr)    (((ptr)->wMBtype & 0x8000) >> 15)
  592. #define readDXVA_MvertFieldSel_2(ptr)    (((ptr)->wMBtype & 0x4000) >> 14)
  593. #define readDXVA_MvertFieldSel_1(ptr)    (((ptr)->wMBtype & 0x2000) >> 13)
  594. #define readDXVA_MvertFieldSel_0(ptr)    (((ptr)->wMBtype & 0x1000) >> 12)
  595. #define readDXVA_ReservedBits(ptr)       (((ptr)->wMBtype & 0x0800) >> 11)
  596. #define readDXVA_HostResidDiff(ptr)      (((ptr)->wMBtype & 0x0400) >> 10)
  597. #define readDXVA_MotionType(ptr)         (((ptr)->wMBtype & 0x0300) >>  8)
  598. #define readDXVA_MBscanMethod(ptr)       (((ptr)->wMBtype & 0x00C0) >>  6)
  599. #define readDXVA_FieldResidual(ptr)      (((ptr)->wMBtype & 0x0020) >>  5)
  600. #define readDXVA_H261LoopFilter(ptr)     (((ptr)->wMBtype & 0x0010) >>  4)
  601. #define readDXVA_Motion4MV(ptr)          (((ptr)->wMBtype & 0x0008) >>  3)
  602. #define readDXVA_MotionBackward(ptr)     (((ptr)->wMBtype & 0x0004) >>  2)
  603. #define readDXVA_MotionForward(ptr)      (((ptr)->wMBtype & 0x0002) >>  1)
  604. #define readDXVA_IntraMacroblock(ptr)    (((ptr)->wMBtype & 0x0001))
  605.  
  606. #define setDXVA_MvertFieldSel_3(ptr)     ((ptr)->wMBtype |= 0x8000)
  607. #define setDXVA_MvertFieldSel_2(ptr)     ((ptr)->wMBtype |= 0x4000)
  608. #define setDXVA_MvertFieldSel_1(ptr)     ((ptr)->wMBtype |= 0x2000)
  609. #define setDXVA_MvertFieldSel_0(ptr)     ((ptr)->wMBtype |= 0x1000)
  610. #define setDXVA_ReservedBits(ptr)        ((ptr)->wMBtype |= 0x0800)
  611. #define setDXVA_HostResidDiff(ptr)       ((ptr)->wMBtype |= 0x0400)
  612. #define setDXVA_MotionType(ptr, value)   ((ptr)->wMBtype |= ((value) << 8))
  613. #define setDXVA_MBscanMethod(ptr, value) ((ptr)->wMBtype |= ((value) << 6))
  614. #define setDXVA_FieldResidual(ptr)       ((ptr)->wMBtype |= 0x0020)
  615. #define setDXVA_H261LoopFilter(ptr)      ((ptr)->wMBtype |= 0x0010)
  616. #define setDXVA_Motion4MV(ptr)           ((ptr)->wMBtype |= 0x0008)
  617. #define setDXVA_MotionBackward(ptr)      ((ptr)->wMBtype |= 0x0004)
  618. #define setDXVA_MotionForward(ptr)       ((ptr)->wMBtype |= 0x0002)
  619. #define setDXVA_IntraMacroblock(ptr)     ((ptr)->wMBtype |= 0x0001)
  620.  
  621. #define readDXVA_Y___0coded(ptr)        (((ptr)->wPatternCode & 0x0800) >> 11)
  622. #define readDXVA_Y___1coded(ptr)        (((ptr)->wPatternCode & 0x0400) >> 10)
  623. #define readDXVA_Y___2coded(ptr)        (((ptr)->wPatternCode & 0x0200) >>  9)
  624. #define readDXVA_Y___3coded(ptr)        (((ptr)->wPatternCode & 0x0100) >>  8)
  625. #define readDXVA_Cb__4coded(ptr)        (((ptr)->wPatternCode & 0x0080) >>  7)
  626. #define readDXVA_Cr__5coded(ptr)        (((ptr)->wPatternCode & 0x0040) >>  6)
  627. #define readDXVA_Cb__6coded(ptr)        (((ptr)->wPatternCode & 0x0020) >>  5)
  628. #define readDXVA_Cr__7coded(ptr)        (((ptr)->wPatternCode & 0x0010) >>  4)
  629. #define readDXVA_Cb__8coded(ptr)        (((ptr)->wPatternCode & 0x0008) >>  3)
  630. #define readDXVA_Cb__9coded(ptr)        (((ptr)->wPatternCode & 0x0004) >>  2)
  631. #define readDXVA_Cr_10coded(ptr)        (((ptr)->wPatternCode & 0x0002) >>  1)
  632. #define readDXVA_Cr_11coded(ptr)        (((ptr)->wPatternCode & 0x0001))
  633.  
  634. #define readDXVA_Y___0oflow(ptr)        (((ptr)->wPC_Overflow & 0x0800) >> 11)
  635. #define readDXVA_Y___1oflow(ptr)        (((ptr)->wPC_Overflow & 0x0400) >> 10)
  636. #define readDXVA_Y___2oflow(ptr)        (((ptr)->wPC_Overflow & 0x0200) >>  9)
  637. #define readDXVA_Y___3oflow(ptr)        (((ptr)->wPC_Overflow & 0x0100) >>  8)
  638. #define readDXVA_Cb__4oflow(ptr)        (((ptr)->wPC_Overflow & 0x0080) >>  7)
  639. #define readDXVA_Cr__5oflow(ptr)        (((ptr)->wPC_Overflow & 0x0040) >>  6)
  640. #define readDXVA_Cb__6oflow(ptr)        (((ptr)->wPC_Overflow & 0x0020) >>  5)
  641. #define readDXVA_Cr__7oflow(ptr)        (((ptr)->wPC_Overflow & 0x0010) >>  4)
  642. #define readDXVA_Cb__8oflow(ptr)        (((ptr)->wPC_Overflow & 0x0008) >>  3)
  643. #define readDXVA_Cb__9oflow(ptr)        (((ptr)->wPC_Overflow & 0x0004) >>  2)
  644. #define readDXVA_Cr_10oflow(ptr)        (((ptr)->wPC_Overflow & 0x0002) >>  1)
  645. #define readDXVA_Cr_11oflow(ptr)        (((ptr)->wPC_Overflow & 0x0001))
  646.  
  647. #pragma pack(pop, BeforeDXVApacking)
  648.  
  649.  
  650.  
  651. // -------------------------------------------------------------------------
  652. //
  653. // The definitions that follow describe the video de-interlace interface
  654. // between the VMR and the graphics device driver.  This interface is not
  655. // accessable via the IAMVideoAccelerator interface.
  656. //
  657. // -------------------------------------------------------------------------
  658. //
  659. #ifndef __DIRECTX_VA_DEINTERLACE__
  660. #define __DIRECTX_VA_DEINTERLACE__
  661.  
  662. typedef LONGLONG REFERENCE_TIME;
  663.  
  664. DEFINE_GUID(DXVA_DeinterlaceBobDevice,
  665.     0x335aa36e,0x7884,0x43a4,0x9c,0x91,0x7f,0x87,0xfa,0xf3,0xe3,0x7e);
  666.  
  667. DEFINE_GUID(DXVA_DeinterlaceContainerDevice,
  668.     0x0e85cb93,0x3046,0x4ff0,0xae,0xcc,0xd5,0x8c,0xb5,0xf0,0x35,0xfd);
  669.  
  670.  
  671. #if(DIRECT3D_VERSION < 0x0800)
  672. typedef DWORD D3DFORMAT;
  673. enum {
  674.     D3DPOOL_DEFAULT                 = 0,
  675.     D3DPOOL_MANAGED                 = 1,
  676.     D3DPOOL_SYSTEMMEM               = 2,
  677.     D3DPOOL_SCRATCH                 = 3,
  678.     D3DPOOL_LOCALVIDMEM             = 4,
  679.     D3DPOOL_NONLOCALVIDMEM          = 5,
  680.     D3DPOOL_FORCE_DWORD             = 0x7fffffff
  681. };
  682. #endif
  683.  
  684.  
  685. // -------------------------------------------------------------------------
  686. // data structures shared by User mode and Kernel mode.
  687. // -------------------------------------------------------------------------
  688. //
  689.  
  690. typedef enum _DXVA_SampleFormat {
  691.     DXVA_SamplePreviousFrame = 1,
  692.     DXVA_SampleProgressiveFrame = 2,
  693.     DXVA_SampleFieldInterleavedEvenFirst = 3,
  694.     DXVA_SampleFieldInterleavedOddFirst = 4,
  695.     DXVA_SampleFieldSingleEven = 5,
  696.     DXVA_SampleFieldSingleOdd = 6,
  697. } DXVA_SampleFormat;
  698.  
  699. typedef struct _DXVA_Frequency {
  700.     DWORD Numerator;
  701.     DWORD Denominator;
  702. } DXVA_Frequency;
  703.  
  704. typedef struct _DXVA_VideoDesc {
  705.     DWORD               Size;
  706.     DWORD               SampleWidth;
  707.     DWORD               SampleHeight;
  708.     DXVA_SampleFormat   SampleFormat;
  709.     D3DFORMAT           d3dFormat;
  710.     DXVA_Frequency      InputSampleFreq;
  711.     DXVA_Frequency      OutputFrameFreq;
  712. } DXVA_VideoDesc, *LPDXVA_VideoDesc;
  713.  
  714. typedef enum _DXVA_VideoProcessCaps {
  715.     DXVA_VideoProcess_None       = 0x0000,
  716.     DXVA_VideoProcess_YUV2RGB    = 0x0001,
  717.     DXVA_VideoProcess_StretchX   = 0x0002,
  718.     DXVA_VideoProcess_StretchY   = 0x0004,
  719.     DXVA_VideoProcess_AlphaBlend = 0x0008,
  720.     DXVA_VideoProcess_SubRects   = 0x0010
  721. } DXVA_VideoProcessCaps;
  722.  
  723. typedef enum _DXVA_DeinterlaceTech {
  724.  
  725.     // the algorithm is unknown or proprietary
  726.     DXVA_DeinterlaceTech_Unknown                = 0x0000,
  727.  
  728.     // the algorithm creates the missing lines by repeating
  729.     // the line either above or below it - this method will look very jaggy and
  730.     // isn't recommended
  731.     DXVA_DeinterlaceTech_BOBLineReplicate       = 0x0001,
  732.  
  733.  
  734.     // the algorithm creates the missing lines by vertically stretching each
  735.     // video field by a factor of two.  Slight vertical adjustments are made to
  736.     // ensure that the resulting image does not "bob" up and down.
  737.     // The algorithm creates the missing lines by vertically stretching each
  738.     // video field by a factor of two, for example by averaging two lines or
  739.     // using a [-1, 9, 9, -1]/16 filter across four lines.
  740.     // Slight vertical adjustments are made to ensure that the resulting image
  741.     // does not "bob" up and down.
  742.     DXVA_DeinterlaceTech_BOBVerticalStretch     = 0x0002,
  743.  
  744.     // the pixels in the missing line are recreated by a median filtering operation
  745.     DXVA_DeinterlaceTech_MedianFiltering        = 0x0004,
  746.  
  747.     // the pixels in the missing line are recreated by an edge filter.
  748.     // In this process, spatial directional filters are applied to determine
  749.     // the orientation of edges in the picture content, and missing
  750.     // pixels are created by filtering along (rather than across) the
  751.     // detected edges.
  752.     DXVA_DeinterlaceTech_EdgeFiltering          = 0x0010,
  753.  
  754.     // the pixels in the missing line are recreated by switching on a field by
  755.     // field basis between using either spatial or temporal interpolation
  756.     // depending on the amount of motion.
  757.     DXVA_DeinterlaceTech_FieldAdaptive          = 0x0020,
  758.  
  759.     // the pixels in the missing line are recreated by switching on a pixel by pixel
  760.     // basis between using either spatial or temporal interpolation depending on
  761.     // the amount of motion..
  762.     DXVA_DeinterlaceTech_PixelAdaptive          = 0x0040,
  763.  
  764.     // Motion Vector Steering  identifies objects within a sequence of video
  765.     // fields.  The missing pixels are recreated after first aligning the
  766.     // movement axes of the individual objects in the scene to make them
  767.     // parallel with the time axis.
  768.     DXVA_DeinterlaceTech_MotionVectorSteered      = 0x0080
  769.  
  770. } DXVA_DeinterlaceTech;
  771.  
  772. typedef struct _DXVA_VideoSample {
  773.     REFERENCE_TIME      rtStart;
  774.     REFERENCE_TIME      rtEnd;
  775.     DXVA_SampleFormat   SampleFormat;
  776.     VOID*               lpDDSSrcSurface;
  777. } DXVA_VideoSample, *LPDXVA_VideoSample;
  778.  
  779. typedef struct _DXVA_DeinterlaceCaps {
  780.     DWORD                   Size;
  781.     DWORD                   NumPreviousOutputFrames;
  782.     DWORD                   InputPool;
  783.     DWORD                   NumForwardRefSamples;
  784.     DWORD                   NumBackwardRefSamples;
  785.     D3DFORMAT               d3dOutputFormat;
  786.     DXVA_VideoProcessCaps   VideoProcessingCaps;
  787.     DXVA_DeinterlaceTech    DeinterlaceTechnology;
  788. } DXVA_DeinterlaceCaps, *LPDXVA_DeinterlaceCaps;
  789.  
  790.  
  791.  
  792.  
  793. // -------------------------------------------------------------------------
  794. // Data types used with RenderMoComp in kernel mode
  795. // -------------------------------------------------------------------------
  796. //
  797.  
  798. // Function codes for RenderMoComp
  799.  
  800. #define MAX_DEINTERLACE_SURFACES                        32
  801.  
  802. typedef struct _DXVA_DeinterlaceBlt {
  803.     DWORD               Size;
  804.     DWORD               Reserved;
  805.     REFERENCE_TIME      rtTarget;
  806.     RECT                DstRect;
  807.     RECT                SrcRect;
  808.     DWORD               NumSourceSurfaces;
  809.     FLOAT               Alpha;
  810.     DXVA_VideoSample    Source[MAX_DEINTERLACE_SURFACES];
  811. } DXVA_DeinterlaceBlt;
  812.  
  813. #define DXVA_DeinterlaceBltFnCode                     0x01
  814. // lpInput => DXVA_DeinterlaceBlt*
  815. // lpOuput => NULL /* not currently used */
  816.  
  817.  
  818. #define MAX_DEINTERLACE_DEVICE_GUIDS                    32
  819. typedef struct _DXVA_DeinterlaceQueryAvailableModes {
  820.     DWORD               Size;
  821.     DWORD               NumGuids;
  822.     GUID                Guids[MAX_DEINTERLACE_DEVICE_GUIDS];
  823. } DXVA_DeinterlaceQueryAvailableModes;
  824.  
  825. #define DXVA_DeinterlaceQueryAvailableModesFnCode     0x01
  826. // lpInput => DXVA_VideoDesc*
  827. // lpOuput => DXVA_DeinterlaceQueryAvailableModes*
  828.  
  829.  
  830. typedef struct _DXVA_DeinterlaceQueryModeCaps {
  831.     DWORD               Size;
  832.     GUID                Guid;
  833.     DXVA_VideoDesc      VideoDesc;
  834. } DXVA_DeinterlaceQueryModeCaps;
  835.  
  836. #define DXVA_DeinterlaceQueryModeCapsFnCode           0x02
  837. // lpInput => DXVA_DeinterlaceQueryModeCaps*
  838. // lpOuput => DXVA_DeinterlaceCaps*
  839.  
  840. #endif /*  __DIRECTX_VA_DEINTERLACE__ */
  841.  
  842.  
  843. // -------------------------------------------------------------------------
  844. //
  845. // The definitions that follow describe the video ProcAmp interface
  846. // between the VMR and the graphics device driver.  This interface is not
  847. // accessable via the IAMVideoAccelerator interface.
  848. //
  849. // -------------------------------------------------------------------------
  850. //
  851. #ifndef __DIRECTX_VA_PROCAMPCONTROL__
  852. #define __DIRECTX_VA_PROCAMPCONTROL__
  853.  
  854. DEFINE_GUID(DXVA_ProcAmpControlDevice,
  855.     0x9f200913,0x2ffd,0x4056,0x9f,0x1e,0xe1,0xb5,0x08,0xf2,0x2d,0xcf);
  856.  
  857. typedef enum _DXVA_ProcAmpControlProp {
  858.     DXVA_ProcAmp_None       = 0x0000,
  859.     DXVA_ProcAmp_Brightness = 0x0001,
  860.     DXVA_ProcAmp_Contrast   = 0x0002,
  861.     DXVA_ProcAmp_Hue        = 0x0004,
  862.     DXVA_ProcAmp_Saturation = 0x0008
  863. } DXVA_ProcAmpControlProp;
  864.  
  865.  
  866. typedef struct _DXVA_ProcAmpControlCaps {
  867.     DWORD                   Size;
  868.     DWORD                   InputPool;
  869.     D3DFORMAT               d3dOutputFormat;
  870.     DWORD                   ProcAmpControlProps;// see DXVA_ProcAmpControlProp
  871.     DWORD                   VideoProcessingCaps;// see DXVA_VideoProcessCaps
  872. } DXVA_ProcAmpControlCaps, *LPDXVA_ProcAmpControlCaps;
  873.  
  874. #define DXVA_ProcAmpControlQueryCapsFnCode             0x03
  875. // lpInput => DXVA_VideoDesc*
  876. // lpOuput => DXVA_ProcAmpControlCaps*
  877.  
  878.  
  879. typedef struct _DXVA_ProcAmpControlQueryRange {
  880.     DWORD                   Size;
  881.     DXVA_ProcAmpControlProp ProcAmpControlProp;
  882.     DXVA_VideoDesc          VideoDesc;
  883. } DXVA_ProcAmpControlQueryRange, *LPDXVA_ProcAmpControlQueryRange;
  884.  
  885. typedef struct _DXVA_VideoPropertyRange {
  886.     FLOAT   MinValue;
  887.     FLOAT   MaxValue;
  888.     FLOAT   DefaultValue;
  889.     FLOAT   StepSize;
  890. } DXVA_VideoPropertyRange, *LPDXVA_VideoPropertyRange;
  891.  
  892. #define DXVA_ProcAmpControlQueryRangeFnCode            0x04
  893. // lpInput => DXVA_ProcAmpControlQueryRange*
  894. // lpOuput => DXVA_VideoPropertyRange*
  895.  
  896.  
  897. typedef struct _DXVA_ProcAmpControlBlt {
  898.     DWORD               Size;
  899.     RECT                DstRect;
  900.     RECT                SrcRect;
  901.     FLOAT               Alpha;
  902.     FLOAT               Brightness;
  903.     FLOAT               Contrast;
  904.     FLOAT               Hue;
  905.     FLOAT               Saturation;
  906. } DXVA_ProcAmpControlBlt;
  907.  
  908. #define DXVA_ProcAmpControlBltFnCode                   0x01
  909. // lpInput => DXVA_ProcAmpControlBlt*
  910. // lpOuput => NULL /* not currently used */
  911.  
  912.  
  913.  
  914. #endif /*  __DIRECTX_VA_PROCAMPCONTROL__ */
  915.  
  916.  
  917. #ifdef __cplusplus
  918. }
  919. #endif
  920.  
  921. #endif /* __DIRECTX_VA__ */
  922.